.class Lrexsee/storage/RexseeZIP$3;
.super Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;
.source "RexseeZIP.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/storage/RexseeZIP;->zip(Ljava/lang/String;Ljava/lang/String;ZZ)Z
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/storage/RexseeZIP;

.field private final synthetic val$sources:Ljava/lang/String;

.field private final synthetic val$target:Ljava/lang/String;


# direct methods
.method constructor <init>(Lrexsee/storage/RexseeZIP;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    iput-object p2, p0, Lrexsee/storage/RexseeZIP$3;->val$sources:Ljava/lang/String;

    iput-object p3, p0, Lrexsee/storage/RexseeZIP$3;->val$target:Ljava/lang/String;

    .line 246
    invoke-direct {p0}, Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;-><init>()V

    return-void
.end method


# virtual methods
.method public run()Z
    .locals 14

    .prologue
    const/4 v13, 0x0

    .line 250
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->val$sources:Ljava/lang/String;

    const-string v10, "|"

    invoke-virtual {v9, v10}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v9

    if-eqz v9, :cond_0

    .line 251
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->val$sources:Ljava/lang/String;

    const-string v10, "\\|"

    invoke-virtual {v9, v10}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v4

    .line 255
    .local v4, "sourceArray":[Ljava/lang/String;
    :goto_0
    array-length v9, v4

    new-array v6, v9, [Ljava/io/File;

    .line 256
    .local v6, "sourceFiles":[Ljava/io/File;
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_1
    array-length v9, v4

    if-lt v1, v9, :cond_1

    .line 269
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->val$target:Ljava/lang/String;

    invoke-static {v9}, Lrexsee/core/utilities/Utilities;->prepareWriteFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v7

    .line 270
    .local v7, "zipFile":Ljava/io/File;
    if-nez v7, :cond_5

    .line 271
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v9}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v9

    iget-object v10, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v10}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v10

    const-string v11, "Error on creating ZIP file."

    invoke-virtual {v9, v10, v11}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v9, v13

    .line 283
    .end local v7    # "zipFile":Ljava/io/File;
    :goto_2
    return v9

    .line 253
    .end local v1    # "i":I
    .end local v4    # "sourceArray":[Ljava/lang/String;
    .end local v6    # "sourceFiles":[Ljava/io/File;
    :cond_0
    const/4 v9, 0x1

    new-array v4, v9, [Ljava/lang/String;

    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->val$sources:Ljava/lang/String;

    aput-object v9, v4, v13

    .restart local v4    # "sourceArray":[Ljava/lang/String;
    goto :goto_0

    .line 257
    .restart local v1    # "i":I
    .restart local v6    # "sourceFiles":[Ljava/io/File;
    :cond_1
    aget-object v3, v4, v1

    .line 258
    .local v3, "source":Ljava/lang/String;
    invoke-virtual {v3}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v9

    const-string v10, "file://"

    invoke-virtual {v9, v10}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v9

    if-nez v9, :cond_2

    .line 259
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v9}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v9

    iget-object v10, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v10}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v10

    new-instance v11, Ljava/lang/StringBuilder;

    const-string v12, "Invalid source file address: "

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v11, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v9, v10, v11}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v9, v13

    .line 260
    goto :goto_2

    .line 262
    :cond_2
    new-instance v5, Ljava/io/File;

    invoke-static {v3}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v9

    invoke-virtual {v9}, Landroid/net/Uri;->getPath()Ljava/lang/String;

    move-result-object v9

    invoke-direct {v5, v9}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 263
    .local v5, "sourceFile":Ljava/io/File;
    invoke-virtual {v5}, Ljava/io/File;->exists()Z

    move-result v9

    if-eqz v9, :cond_3

    invoke-virtual {v5}, Ljava/io/File;->canRead()Z

    move-result v9

    if-nez v9, :cond_4

    .line 264
    :cond_3
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v9}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v9

    iget-object v10, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v10}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v10

    new-instance v11, Ljava/lang/StringBuilder;

    const-string v12, "Source file ["

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v11, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    const-string v12, "] is not available."

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v9, v10, v11}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v9, v13

    .line 265
    goto :goto_2

    .line 267
    :cond_4
    aput-object v5, v6, v1

    .line 256
    add-int/lit8 v1, v1, 0x1

    goto/16 :goto_1

    .line 275
    .end local v3    # "source":Ljava/lang/String;
    .end local v5    # "sourceFile":Ljava/io/File;
    .restart local v7    # "zipFile":Ljava/io/File;
    :cond_5
    :try_start_0
    new-instance v8, Ljava/util/zip/ZipOutputStream;

    new-instance v9, Ljava/io/BufferedOutputStream;

    new-instance v10, Ljava/io/FileOutputStream;

    invoke-direct {v10, v7}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    const/high16 v11, 0x100000

    invoke-direct {v9, v10, v11}, Ljava/io/BufferedOutputStream;-><init>(Ljava/io/OutputStream;I)V

    invoke-direct {v8, v9}, Ljava/util/zip/ZipOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 276
    .local v8, "zipout":Ljava/util/zip/ZipOutputStream;
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mCompressLevel:I
    invoke-static {v9}, Lrexsee/storage/RexseeZIP;->access$1(Lrexsee/storage/RexseeZIP;)I

    move-result v9

    invoke-virtual {v8, v9}, Ljava/util/zip/ZipOutputStream;->setLevel(I)V

    .line 277
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    const-string v10, ""

    # invokes: Lrexsee/storage/RexseeZIP;->appendToZipArchive([Ljava/io/File;Ljava/util/zip/ZipOutputStream;Ljava/lang/String;)Z
    invoke-static {v9, v6, v8, v10}, Lrexsee/storage/RexseeZIP;->access$2(Lrexsee/storage/RexseeZIP;[Ljava/io/File;Ljava/util/zip/ZipOutputStream;Ljava/lang/String;)Z

    move-result v2

    .line 278
    .local v2, "rtn":Z
    invoke-virtual {v8}, Ljava/util/zip/ZipOutputStream;->finish()V

    .line 279
    invoke-virtual {v8}, Ljava/util/zip/ZipOutputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move v9, v2

    .line 280
    goto/16 :goto_2

    .line 281
    .end local v2    # "rtn":Z
    .end local v8    # "zipout":Ljava/util/zip/ZipOutputStream;
    :catch_0
    move-exception v9

    move-object v0, v9

    .line 282
    .local v0, "e":Ljava/lang/Exception;
    iget-object v9, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    # getter for: Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v9}, Lrexsee/storage/RexseeZIP;->access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;

    move-result-object v9

    iget-object v10, p0, Lrexsee/storage/RexseeZIP$3;->this$0:Lrexsee/storage/RexseeZIP;

    invoke-virtual {v10}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0}, Ljava/lang/Exception;->getLocalizedMessage()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v9, v10, v11}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v9, v13

    .line 283
    goto/16 :goto_2
.end method
